{template 'common/header'}
<link type="text/css" href="{WEBRES}chosen.css" rel="stylesheet" />
  <script src="{WEBRES}chosen.jquery.js" type="text/javascript"></script>

  <script src="{WEBRES}prism.js" type="text/javascript" charset="utf-8"></script>



<form action="{php echo $this->createWebUrl('activityadd')}" method="post" class="form-horizontal form" id="setting-form" onsubmit="return getjson()">
    <div class="panel panel-default">
			<div class="panel-heading">游戏参数设置</div>
			<div class="panel-body">
				<div class="tab-content">
					<div class="tab-pane  active" style="padding:20px;">

                          <div class="form-group">
                                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">是否上架：</label>
                                    <div class="col-xs-12 col-sm-9">
                                       <label class="checkbox-inline">
                                          <input type="radio" name="status" value="0" checked=""> 下架
                                       </label>
                                       <label class="checkbox-inline">
                                          <input type="radio" name="status" value="1"> 上架
                                       </label>                     
                                        <span class="help-block" style="color:#ff0000"></span>
                                    </div>
                          </div>  

                          <div class="form-group">
                                <div class="input-group">
                                    <span class="input-group-addon">活动名称：</span>
                             
                                    <input type="text" name="activityname" placeholder="添加活动的标志" class="form-control">
                                </div>
                                
                           </div>
                          <div class="form-group">
                                <div class="input-group">
                                    <span class="input-group-addon">排序：</span>
                             
                                    <input type="text" name="activityorder" class="form-control">
                                </div>
                                
                           </div>
                          <div class="form-group">
                                <div class="input-group">
                                    <span class="input-group-addon">参与人数：</span>
                             
                                    <input type="text" name="activityplayernum" class="form-control">
                                </div>
                                
                           </div>
                          <div class="form-group">
                                <div class="input-group">
                                    <span class="input-group-addon">活动关联项目</span>
          <select data-placeholder="项目列表" multiple class="chosen-select form-control" width=530>
          <option value=""></option>
			{loop $itemlist $index $item}
            	<option value="{$item['id']}">{$item['itemname']}</option>
			{/loop}
          </select>
          <input id="itemjson" type="hidden" name="itemjson"/>
			<script type="text/javascript">
				function getjson(){
					
					var length = $(".chzn-choices").find("span").length;
					var spanjson = {};
					var i=0;
					for(i=0;i<length;i++){
						spanjson[i]=$(".chzn-choices").find("span").eq(i).text();
					}
					$("#itemjson").val(JSON.stringify(spanjson));
				}
				
			</script>
          <style type="text/css">
          	.chzn-container-multi .chzn-choices .search-choice .search-choice-close {
          	  background: url({WEBRES}chosen-sprite.png) right top no-repeat;
          	}
          </style>
                                </div>
                                
                           </div>
							<div class="form-group">
                                <div class="input-group">
                           			<input type="hidden" name="token" value="{$_W['token']}"/>

                             
									<input type="submit" name="submit" class="btn btn-primary" value="保存"/>

                                </div>
                                
                           </div>
                      <!---->
					</div>
				</div>
			</div>
		</div>

 		
	</form>

  <script type="text/javascript">

    var config = {

      '.chosen-select'           : {},

      '.chosen-select-deselect'  : {allow_single_deselect:true},

      '.chosen-select-no-single' : {disable_search_threshold:10},

      '.chosen-select-no-results': {no_results_text:'Oops, nothing found!'},


    }

    for (var selector in config) {

      $(selector).chosen(config[selector]);

    }

  </script>
{template 'common/footer'}